package cn.edu.gzhu.workOrderManagement.util;

import cn.edu.gzhu.workOrderManagement.result.Result;
import cn.hutool.json.JSONUtil;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ResponseUtil {
    public static void failResponse(HttpServletResponse httpServletResponse, String msg) throws IOException {
        httpServletResponse.setContentType("application/json;charset=UTF-8");
        httpServletResponse.setStatus(200);
        httpServletResponse.getWriter().write(JSONUtil.parse(Result.error(msg)).toString());

    }




}
